#include "FourTouch.h"

FourTouch::FourTouch (int sdaPin, int sclPin): SoftI2CMaster(sclPin, sdaPin) {}

bool FourTouch::compareFourWayTouchStatus (int touchChannel) {
    this->requestFrom(0x50);
    // 获取数据
    unsigned char data = this->read();
    this->endTransmission();
    // 处理数据
    for(int i = 0; i <= touchChannel; ++ i) {
        if( !(data & 0x01) )
            return true;
        // 右移后赋值
        data >>= 1;
    }
    return false;
}